import java.util.Scanner;

public class demo6 {
    public static void divide() throws Exception{
        Scanner input=new Scanner(System.in);

            System.out.println("请输入被除数：");
            int num1=input.nextInt();
            System.out.println("请输入除数：");
            int num2=input.nextInt();
            System.out.println("num1/num2="+num1/num2);
    }

    public static void main(String[] args) {
        try {
            divide();
        }catch (Exception ex){
            System.out.println("出现错误：被除数和除数必须是整数，除数不能为零。");
            ex.printStackTrace();
        }
    }
}
